{% extends 'KeioStudyBundle::layout.html.twig' %}

{% block content %}
    <h3>Modify question</h3>


    <form action="{{ path('keio_cauhoi_update', {id: entity.id}) }}" method="post" {{ form_enctype(form) }}>

<div id="tabs" style="border: 1px dashed #cdcdcd; height:460px">
  <ul>
    <li><a href="#tabs-1">General</a></li>
    <li><a href="#tabs-2">Detail</a></li>
    <li><a href="#tabs-3">Suggestion</a></li>
    {% if entity.loai==0 %}
	    <li><a href="#tabs-4">Answer 1</a></li>
	    <li><a href="#tabs-5">Answer 2</a></li>
	    <li><a href="#tabs-6">Answer 3</a></li>
	    <li><a href="#tabs-7">Answer 4</a></li>
	    <li><a href="#tabs-8">Correct answer</a></li>
	{% else %}
		<li><a href="#tabs-4">Answer design</a></li>
    {% endif %}
  </ul>
  <div id="tabs-1" style="padding-top:30px">
    <table width="100%">
		    <tr>
		      <td width="25%">
		        <p>Loại câu hỏi
		      </td>
		      <td>
		        <div id="form_cauhoi_loai">
		        <input type="radio" id="cauhoi_loai_0" name="cauhoi_loaiDisabled" required="required" value="0"
		        	{% if entity.loai==0 %}
		        		checked
		        	{% endif %}
		        disabled>
		        <label for="cauhoi_loai_0" class="required">Trắc nghiệm</label>
		        <input type="radio" id="cauhoi_loai_1" name="cauhoi_loaiDisabled" required="required" value="1"
		        	{% if entity.loai==1 %}
		        		checked
		        	{% endif %}
		        disabled>
		        <label for="cauhoi_loai_1" class="required">Tự trả lời</label>

		        <input type="hidden" id="cauhoi_loai_ok" name="cauhoi_loai" value="{{ entity.loai }}" >

		        </div>
		      </td>
		    </tr>
		    <tr>
		      <td>
		        <p>Tiêu đề
		      </td>
		      <td>
		        {{ form_widget(form.tieude) }}
		      </td>
		    </tr>
		    <tr>
		      <td>
		        <p>Môn học
		      </td>
		      <td>
		        {{ form_widget(form.monhoc) }}
		      </td>
		    </tr>
		    <tr>
		      <td>
		        <p>Điểm
		      </td>
		      <td>
		        {{ form_widget(form.diem) }}
		      </td>
		    </tr>
	</table>
  </div>



  <div id="tabs-2">
		Nội dung
		<br>
		{{ form_widget(form.noidung, { 'attr': {'class': 'ckeditor'} }) }}
  </div>

  <div id="tabs-3">
		Gợi ý
		<br>
        {{ form_widget(form.goiy, { 'attr': {'class': 'ckeditor'} }) }}
  </div>

  	{% if entity.loai==0 %}
	    {% include 'KeioStudyBundle:Cauhoi:addcauhoi_formtracnghiem.html.twig' %}
	{% else %}
		{% include 'KeioStudyBundle:Cauhoi:addcauhoi_formtutraloi.html.twig' %}
    {% endif %}

</div>

    	{{ form_rest(form) }}

    	{% for tlid in traloiid %}
    		<input type="hidden" name="traloiid[]" value="{{ tlid }}">
    	{% endfor %}

    	<div style="text-align:right; padding-top:10px">
	    	<button type="submit">Modify</button>
	    </div>
    </form>

<table width=100%>

<tr>
<td colspan="2">
	<ul class="record_actions">
    	<li>
        <a href="{{ path('keio_cauhoi') }}">
            Back to the list
        </a>
    	</li>
	</ul>
</td>
</tr>
</table>
{% endblock %}



{% block morejavascripts %}

		<script>
		  $(function() {
		    $( "#tabs" ).tabs();
		  });
		</script>


{% endblock %}